<layout name="layout" />
<form action="__ACTION__" method="GET" name="searchForm">
<div class="form-div">
        <P>
            品   牌：
            <?php buildSelect('brand','brand_id','id','brand_name',I("get.brand_id"));?>
        </P>
        <P>
            商品名称：
            <input value="<?php echo I('get.gn'); ?>" type="text" name="gn" size="60" />
        </P>
        <P>
            本店价格：
            从<input value="<?php echo I('get.fp'); ?>" type="text" name="fp" size="8" />
            到<input value="<?php echo I('get.tp'); ?>" type="text" name="tp" size="8" />
        </P>
        <P>
            是否上架：
            <?php $ios = I('get.ios'); ?>
            <input type="radio" name="ios" value="" <?php if($ios == '') echo 'checked="checked"'; ?> /> 全部
            <input type="radio" name="ios" value="是" <?php if($ios == '是') echo 'checked="checked"'; ?> /> 上架
            <input type="radio" name="ios" value="否" <?php if($ios == '否') echo 'checked="checked"'; ?> /> 下架
        </P>
        <P>
            添加时间：
            从<input type="text" id="fa" name="fa" value="<?php echo I('get.fa'); ?>" size="20" />
            到<input type="text" id="ta" name="ta" value="<?php echo I('get.ta'); ?>" size="20" />
        </P>
        <p>
            排序方式：
            <?php $obdy = I('get.odby', 'id_desc');  // 如果odby为空，那么默认是id_desc ?>
            <input onclick="this.parentNode.parentNode.submit();" type="radio" name="odby" value="id_desc" <?php if($obdy == 'id_desc') echo 'checked="checked"'; ?> /> 以添加时间降序
            <input onclick="this.parentNode.parentNode.submit();" type="radio" name="odby" value="id_asc" <?php if($obdy == 'id_asc') echo 'checked="checked"'; ?> /> 以添加时间升序
            <input onclick="this.parentNode.parentNode.submit();" type="radio" name="odby" value="price_desc" <?php if($obdy == 'price_desc') echo 'checked="checked"'; ?> /> 以价格降序
            <input onclick="this.parentNode.parentNode.submit();" type="radio" name="odby" value="price_asc" <?php if($obdy == 'price_asc') echo 'checked="checked"'; ?> /> 以价格升序
        </p>
        <P>
            <input type="submit" value="搜索" />
        </P>
</div>

<!-- 商品列表 -->
<!--<form method="get" action="__ACTION__" name="listForm" onsubmit="">-->
    <div class="list-div" id="listDiv">
        <table cellpadding="3" cellspacing="1">
            <tr>
                <th>编号</th>
                <th>品牌</th>
                <th>商品名称</th>
                <th>logo</th>
                <th>市场价格</th>
                <th>本店价格</th>
                <th>上架</th>
                <th>添加时间</th>
                <th>操作</th>
            </tr>

            <?php foreach($data as $k=>$v){?>
            <tr class="tron">
                <td align="center"><?php echo $v['id']?></td>
                <td align="center"><?php echo $v['brand_name']?></td>
                <td align="center" class="first-cell"><span><?php echo $v['goods_name']?></span></td>
                <td align="center"><span onclick=""><?php showImage($v['sm_logo'])?></span></td>
                <td align="center"><?php echo $v['market_price']; ?></td>
                <td align="center"><?php echo $v['shop_price']; ?></td>
                <td align="center"><?php echo $v['is_on_sale']; ?></td>
                <td align="center"><?php echo $v['addtime']; ?></td>
                <td align="center">
                    <a href="<?php echo U('edit?id='.$v['id'].'&p='.I('get.p',1)); ?>">修改</a>
                    <a onclick="return confirm('确定要删除吗？');" href="<?php echo U('delete?id='.$v['id'].'&p='.I('get.p',1)); ?>">删除</a>
                </td>
            </tr>
            <?php }?>
        </table>

    <!-- 分页开始 -->
        <table id="page-table" cellspacing="0">
            <tr>
                <td width="65%">&nbsp;</td>
                <td id="fenye" align="center" nowrap="true">
                    {$page}
                    <div style="float:left;">
                        跳转到<input type="text" id="text" value="<?php echo I('get.p')?>" name="p">页
                        <input type="submit" value="Go">
                    </div>
                </td>
            </tr>
        </table>
    <!-- 分页结束 -->
    </div>
</form>



<!-- 引入时间插件 -->
<link href="__PUBLIC__/datetimepicker/jquery-ui-1.9.2.custom.min.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="__PUBLIC__/umeditor1_2_2-utf8-php/third-party/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/datetimepicker/jquery-ui-1.9.2.custom.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/datetimepicker/datepicker-zh_cn.js"></script>
<link rel="stylesheet" media="all" type="text/css" href="__PUBLIC__/datetimepicker/time/jquery-ui-timepicker-addon.min.css" />
<script type="text/javascript" src="__PUBLIC__/datetimepicker/time/jquery-ui-timepicker-addon.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/datetimepicker/time/i18n/jquery-ui-timepicker-addon-i18n.min.js"></script>
<script>
    // 添加时间插件
    $.timepicker.setDefaults($.timepicker.regional['zh-CN']);  // 设置使用中文
    $("#fa").datetimepicker();
    $("#ta").datetimepicker();
</script>

<!--//鼠标指上变色-->
<script type="text/javascript" src="__PUBLIC__/Admin/Js/tron.js"></script>